Repository navigation
chore: remove test counters and switches from production paths - #513
Merged
Merged
Conversation
- Drop the [ThreadStatic] planning counters from QRCodeGenerator and StructuredAppendPlanner. Tests that only checked a path was taken are removed or now assert the output. - Drop the Micro QR grid evidence switch. Tests state the measured premise with its date instead. - Replace the module buffer peak counter with ArrayPoolRentWatch, an EventListener on the array pool's events that counts the most arrays of one size out at once. - Standard QR DecodeSymbols rents its candidate list and image buffer once per call as one array, longer than any module workspace, so no two arrays of one size are out at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Standard QR DecodeSymbols rents its candidate list and image buffer apart again. One array rounded up to the next power of two, so a 1000 x 1000 image held 2 MiB instead of 1 MiB and 64 KiB, and a second same-size rent measured tens of nanoseconds with no pool allocation on 32 threads. - Comments say the shared stacks are empty only while other threads hold the arrays they had, instead of saying the rent allocates. - The spec records the measurement and why the buffers stay apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes counters and switches that existed only for tests from production code. Tests now check behavior from the outside.
Intent
Several
[ThreadStatic]counters and one switch lived insrconly so tests could see which path ran. Each counter cost an increment on hot paths, and each one added a production seam no caller uses. The tests now assert the output, or watch the array pool's events, instead.Changes
QRCodeGeneratorandStructuredAppendPlanner(ScalarWalks,LaneBatchesand the generator's counters). Tests that only checked which path ran are removed or now assert the output. For example,StructuredAppendWriterPlanTestrequires the same modules whether the chunks are planned together or one by one.QRImageDecoder.ModuleBuffersPeakwithArrayPoolRentWatchin the test project. It is anEventListeneron the array pool's events that reports the most arrays of one size this thread had out at once. The Standard QR one-symbol tests still require one array of a size at a time, for reads and for rejected images.Before / After
[ThreadStatic]counters insrcsrc🤖 Generated with Claude Code